package com.atguigu.gmall.item.client.impl;

import com.atguigu.gmall.item.client.ItemFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author Fxz
 * @version 1.0
 * @date 2022-02-08 10:49
 */
@Slf4j
@Component
public class ItemDegradeFeignClient implements FallbackFactory<ItemFeignClient> {

	@Override
	public ItemFeignClient create(Throwable throwable) {
		return skuId -> {
			log.error("调用失败:{}", skuId);
			return null;
		};
	}

}
